package Work;

import java.util.Scanner;
//import util.java.Scanner;
public class Work3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入月数：");
        int m = scanner.nextInt();
        System.out.println("第1个月的兔子对数: 1");
        System.out.println("第2个月的兔子对数: 1");
        int f1 = 1, f2 = 1, f;
        for (int i = 3; i <= m; i++) {
            f = f2;
            f2 = f1 + f2;
            f1 = f;
            System.out.println("第" + i + "个月的兔子对数:" + f2);
        }
    }

    public static void main9(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = 1;
        int num2 = 1;
        int tmp = 0;
        int mou = 0;
        System.out.println("请输入月数");
        mou = scanner.nextInt();
        for (int i = 1; i <= mou; i++) {
            if( i == 1 || i == 2) {
                System.out.println(i+"月"+"兔子："+1);
            } else {
                tmp = num2;
                num2 = num + num2;
                num = tmp;
                System.out.println(i+"月"+"兔子:"+num2);
            }

        }


    }



    public static void main7(String[] args) {
        double lucheng=100;
        double high=lucheng/2;
        int i = 0;
        for (i = 2;i<10;i ++)
        {
            lucheng=lucheng+high*2;
            high=high/ 2;
        }
        System.out.println("第"+i+"次落地经过"+lucheng+"米");
        System.out.println("第"+i+"次反弹"+high+"米");
    }

    public static void main8(String[] args) {
        double yuan = 100.0;
        double h = yuan/2;
        for (int i = 2; i < 10; i++) {
            yuan = yuan + h*2;
            h /= 2;
        }

        System.out.println("总长度:"+yuan);
        System.out.println("10 反弹的高度:"+h);

    }




    public static void main6(String[] args) {
        int sum=1;
        for(int i=1;i<10;i++)
        {
            sum=(sum+1)*2;
        }
        System.out.println("猴子第一天一共摘了桃子的个数是："+sum);
    }



    public static void main5(String[] args) {
        int sum = 1;
        for (int i = 1; i < 10; i++) {
            sum = (sum+1)*2;
        }
        System.out.println(sum);
    }



    public static void main4(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 100; i+=2) {
            sum +=i;
        }
        System.out.println("sum ="+sum);
    }



    public static void main3(String[] args) {
        for(int m=1;m<1000;m++)
        {
            int sum=0;
            for(int n=1;n<m;n++)
            {
                if(m%n==0)
                {
                    sum=sum+n;
                }
            }
            if(m==sum)
                System.out.println(m);
        }
    }
}




    /*
    public static void main(String[] args) {
        for (int i = 1; i < 1000; i++) {
            int sum = 0;
            for (int j = 1; j < i; j++) {
                if(i%j == 0) {
                    sum += j;
                }
            }
            if(sum == i) {
                System.out.print(" "+sum);
            }
        }
    }

     */
